package cn.changeforyou.analyzer.combine.orm.compare.compareResultProcessor.cmdParamters;

import cn.changeforyou.cmd.generator.CmdGeneratorParameter;
import cn.changeforyou.utils.string.StringUtils;
import com.beust.jcommander.Parameter;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * @author zhyu
 * @date 2021/2/24 15:17
 */
@Data
public class DeleteParameters implements CmdGeneratorParameter {

    @Parameter(names = {"-a", "all"}, description = "全部")
    private boolean all;

    @Parameter(names = {"-d", "del"}, description = "需要删除的字段名, 多个字段用英文逗号分隔")
    @NotNull
    private String deleteFieldNames;

    @Parameter(names = {"-h", "-help"}, description = "帮助文档")
    private boolean help;

    @Override
    public boolean isHelp() {
        return help;
    }

    @Override
    public void isHelp(boolean isHelp) {
        this.help = isHelp;
    }

    @Override
    public boolean check() {
        return all ?true: StringUtils.isEmpty(deleteFieldNames);
    }

    @Override
    public String getSign() {
        return "deleteParameters";
    }
}
